import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Main from '../views/Main.vue'
import DefectAssign from '../components/defect/DefectAassign.vue'
import DefectComment from '../components/defect/DefectComment.vue'
import DefectDeal from '../components/defect/DefectDeal.vue'
import DefectList from '../components/defect/DefectList.vue'
import Member from '../components/project/Member.vue'
import Project from '../components/project/Project.vue'
import ReportSeverity from '../components/report/ReportSeverity.vue'
import ReportState from '../components/report/ReportState.vue'
import ReportType from '../components/report/ReportType.vue'
import ReportWorkoursByday from '../components/report/ReportWorkoursByday.vue'
import ReportWorkoursBymonth from '../components/report/ReportWorkoursBymonth.vue'
import StstemDefectpriority from '../components/ststem/StstemDefectpriority.vue'
import StstemDefectseverity from '../components/ststem/StstemDefectseverity.vue'
import StstemDefectstate from '../components/ststem/StstemDefectstate.vue'
import StstemDefecttype from '../components/ststem/StstemDefecttype.vue'
import SystemRole from '../components/system/SystemRole.vue'
import SystemUser from '../components/system/SystemUser.vue'
import Manager from '../views/Manager.vue'


Vue.use(VueRouter) 
//解决重复路由报错
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

const routes = [
  {
    path: '/',
    name: 'Login',
    component: Login
  },
  {
    path: '/manager',
    name: 'Manager',
    component: Manager,
	children:[
		{
		  path: '/manager/system-user',
		  name: 'system-user',
		  component: SystemUser
		},
		{
		  path: '/manager/system-role',
		  name: 'system-role',
		  component: SystemRole
		},
		{
		  path: '/manager/ststem-defectpriority',
		  name: 'ststem-defectpriority',
		  component: StstemDefectpriority
		},
		{
		  path: '/manager/ststem-defectseverity',
		  name: 'ststem-defectseverity',
		  component: StstemDefectseverity
		},{
		  path: '/manager/ststem-defecttype',
		  name: 'ststem-defecttype',
		  component: StstemDefecttype
		},{
		  path: '/manager/ststem-defectstate',
		  name: 'ststem-defectstate',
		  component: StstemDefectstate
		}
	]
  },
  {
    path: '/main',
    name: 'Main',
    component: Main,
	children:[
		{
		  path: '/main/project',
		  name: 'project',
		  component: Project
		},{
		  path: '/main/member',
		  name: 'member',
		  component: Member
		}
		,{
		  path: '/main/defect-list',
		  name: 'ststem-defect-list',
		  component: DefectList
		},{
		  path: '/main/defect-assign',
		  name: 'ststem-defect-assign',
		  component: DefectAssign
		},{
		  path: '/main/defect-deal',
		  name: 'ststem-defect-deal',
		  component: DefectDeal
		},{
		  path: '/main/defect-comment',
		  name: 'ststem-defect-comment',
		  component: DefectComment
		},{
		  path: '/main/report-type',
		  name: 'report-type',
		  component: ReportType
		},{
		  path: '/main/report-state',
		  name: 'report-state',
		  component: ReportState
		},{
		  path: '/main/report-severity',
		  name: 'report-severity',
		  component: ReportSeverity
		},{
		  path: '/main/report-workoursByday',
		  name: 'report-workoursByday',
		  component: ReportWorkoursByday
		},{
		  path: '/main/report-workoursBymonth',
		  name: 'report-workoursBymonth',
		  component: ReportWorkoursBymonth
		}
	]
  }
 
]

const router = new VueRouter({
  routes

})
export default router
